<?= doctype('xhtml1-trans') ?>
<html xmlns="http://wwww.w3.org/1999/xhtml">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <title><?= WEB_NAME ?><?= $title ? " - {$title}" : "" ?></title>
    <!--基本css-->
    <?= css(array(
        'font-awesome/font-awesome.css',
        'font-custom/font-custom.css',
        JS_DOMAIN.'jquery-ui/css/jquery-ui.css',
        JS_DOMAIN.'jquery/jquery-artdialog/skins/tcfs.css',
        JS_DOMAIN.'jquery/jquery-select2/select2.css',
        'bootstrap/bootstrap.css',
        'style.css',
        'responsive.css',
    )) ?>

    <!--附加css-->
    <?= css($css) ?>

    <!--基本js-->
    <?= js(array(
        'jquery/lib/jquery.js',
        'jquery-ui/js/jquery-ui.custom.js',
        'bootstrap/lib/bootstrap.js',
        'url.js',
        'base.js',
        'style.js',
        'jquery/jquery-artdialog/jquery.artDialog.js',
        'jquery/jquery-artdialog/plugins/iframeTools.js',
        'jquery/jquery-validate/jquery.validate.js',
        'jquery/jquery-select2/select2.js',
        'jquery/jquery-select2/select2_locale_zh-CN.js',
    )) ?>
</head>
<body>
    <? if($page_style['show_header'] !== FALSE): ?>
        <!-- BEGIN HEADER -->
        <div class="header navbar navbar-inverse ">
            <!-- BEGIN TOP NAVIGATION BAR -->
            <div class="navbar-inner">
                <div class="header-seperation">
                    <ul style="display:none" id="main-menu-toggle-wrapper" class="nav pull-left notifcation-center">
                        <li class="dropdown"> <a class="" href="#main-menu" id="main-menu-toggle">
                            <div class="iconset top-menu-toggle-white"></div>
                            </a> 
                        </li>
                    </ul>
                    <!-- BEGIN LOGO -->
                    <a href="index.html">
                      <img width="160" height="21" class="logo" src="<?= IMG_DOMAIN.'logo.png'?>">
                    </a>
                    <!-- END LOGO -->
                    <ul class="nav pull-right notifcation-center">
                        <li id="header_task_bar" class="dropdown">
                            <a class="dropdown-toggle active" href="<?= DOMAIN.'home/index' ?>" title="访问首页">
                                <div class="iconset top-home"></div>
                            </a> 
                        </li>
                    </ul>
                </div>
                <!-- END RESPONSIVE MENU TOGGLER -->
                <div class="header-quick-nav">
                  <!-- BEGIN TOP NAVIGATION MENU -->
                    <div class="pull-left">
                        <ul class="nav quick-section">
                            <li class="quicklinks"> 
                                <a id="layout-condensed-toggle" class="" href="#" title="关闭侧边栏">
                                    <div class="iconset top-menu-toggle-dark"></div>
                                </a> 
                            </li>
                        </ul>
                        <ul class="nav quick-section">
                            <li class="quicklinks"> 
                                <a id="layout-refresh-toggle" class="" href="#" title="刷新">
                                    <div class="iconset top-reload"></div>
                                </a> 
                            </li>
                        </ul>
                    </div>
                  <!-- END TOP NAVIGATION MENU -->
                  <!-- BEGIN CHAT TOGGLER -->
                  <div class="pull-right">
                    <ul class="nav quick-section ">
                        <li class="quicklinks">
                            <a href="#" class="dropdown-toggle  pull-right" data-toggle="dropdown" title="系统设置">
                                <div class="iconset top-settings-dark "></div>
                            </a>
                            <ul aria-labelledby="dropdownMenu" role="menu" class="dropdown-menu pull-right">
                                <li>
                                    <a href='<?= DOMAIN."center/profile" ?>'>个人中心</a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a href="<?= DOMAIN.'home/logout' ?>" title="登出">
                                    <i class="icon-off"></i>&nbsp;&nbsp;登出</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                  </div>
                  <!-- END CHAT TOGGLER -->
                </div>
            <!-- END TOP NAVIGATION MENU -->
            </div>
          <!-- END TOP NAVIGATION BAR -->
        </div>
        <!-- END HEADER -->
    <? endif ?>

    <!-- BEGIN CONTAINER -->
    <div class="page-container row-fluid">
        <? $admin = login_info() ?>
        <? $env   = server_env() ?>
        <!-- BEGIN MENU -->
        <div id="main-menu" class="page-sidebar <?= $page_style['show_menu'] === FALSE ? 'hide' : '' ?>">
            <!-- BEGIN MINI-PROFILE -->
            <div class="user-info-wrapper">
                <div class="profile-wrapper"> 
                    <? if($admin['avatar_version']): ?>
                        <img width="70" height="70" src="<?= DATA_DOMAIN."admin/{$admin['admin_id']}/avatar_upload_thumb.png?v={$admin['avatar_version']}" ?>">
                    <? endif ?>
                </div>
              <div class="user-info">
                <div class="greeting">欢迎</div>
                <div class="username"><?= $admin['nickname'] ?></div>
                <div class="status">状态
                    <? if($env['env'] == 'development'): ?>
                        <a href="#">
                            <div class="status-icon blue"></div>开发
                        </a>
                    <? endif ?>
                    <? if($env['env'] == 'testing'): ?>
                        <a href="#">
                            <div class="status-icon red"></div>测试
                        </a>
                    <? endif ?>
                    <? if($env['env'] == 'production'): ?>
                        <a href="#">
                            <div class="status-icon green"></div>正式
                        </a>
                    <? endif ?>
                </div>
              </div>
            </div>
            <!-- END MINI-PROFILE -->

            <!-- BEGIN SIDEBAR MENU -->
            <? $menu = menu_info() ?>
            <? if($menu): ?>
            <? foreach($menu as $m1): ?>
                <p class="menu-title"><?= $m1['name'] ?></p>
                <ul>
                    <? if($m1['children']): ?>
                    <? foreach($m1['children'] as $m2): ?>
                        <? if($m2['children']): ?>
                            <li class=""> 
                                <a href="javascript:;">
                                    <i class="<?= $m2['class'] ?>"></i>
                                    <span class="title"><?= $m2['name'] ?></span> 
                                    <span class="arrow "></span> 
                                </a>
                                <ul class="sub-menu">
                                    <? if($m2['children']): ?>
                                    <? foreach($m2['children'] as $m3): ?>
                                        <li>
                                            <a href="<?= DOMAIN.$m3['url'] ?>"><?= $m3['name'] ?></a>
                                        </li>
                                    <? endforeach ?>
                                    <? endif ?>
                                </ul>
                            </li>
                        <? else: ?>
                            <li class=""> 
                                <a href="<?= DOMAIN.$m2['url'] ?>">
                                    <i class="<?= $m2['class'] ?>"></i>
                                    <span class="title"><?= $m2['name'] ?></span>
                                </a>
                            </li>
                        <? endif ?>
                    <? endforeach ?>
                    <? endif ?>
                </ul>
            <? endforeach ?>
            <? endif ?>
        </div>
        <!-- END MENU -->

        <!-- BEGIN MENU-FOOTER -->
        <div class="footer-widget <?= $page_style['show_menu'] === FALSE ? 'hide' : '' ?>">
            <div class="pull-right">
                <a href="<?= DOMAIN.'home/logout' ?>" title="登出"><i class="icon-off"></i></a>
            </div>
        </div>
        <!-- END MENU-FOOTER -->
        

        <!-- BEGIN PAGE -->
        <div class="page-content <?= $page_style['show_title'] === FALSE ? "condensed" : "" ?>" style="min-height:<?= $page_style['min_height'] ?>; background-color:<?= $page_style['page_color'] ?>">
        
            <!-- BEGIN CONTENT -->
            <div class="content" <? if($page_style['show_title'] === FALSE): ?>style="padding-top:26px"<? endif ?>>
                <? if($page_style['show_breadcrumb'] !== FALSE): ?>
                    <? $breadcrumb = breadcrumb() ?>
                    <ul class="breadcrumb">
                        <? if($breadcrumb): ?>
                            <? $count = count($breadcrumb); $i=0 ?>
                            <? foreach ($breadcrumb as $b): ?>
                                <li>
                                    <p><?= $b ?></p>
                                </li>
                                <? if($i < $count-1): ?>
                                    <i class="icon-angle-right"></i>
                                <? endif ?>
                                <? $i++ ?>
                            <? endforeach ?>
                        <? endif ?>
                    </ul>
                    <div class="page-title"> 
                        <a href="#" onclick="$.T.goback()"><i class="icon-custom-left"></i></a>  
                        <h3>
                            <?= end($breadcrumb) ?>
                        </h3>  
                    </div>
                <? endif ?>
                <div id="container">